Skip to content

激活 - Activate

函数简介

使用激活码激活软件,完成授权激活。激活码在欧拉后台生成

返回数据格式:

json
{
  "EndTime": "2026-03-01 11:40:41.193",
  "LicenseType": 3,
  "LicenseTypeStr": "月卡",
  "Message": "",
  "RemainingCount": 0,
  "ServerTime": "2025-12-30 11:40:41.132",
  "Status": 0,
}
字段名说明
EndTime授权到期时间。
LicenseType授权类型:0次卡,1小时卡,2日卡,3月卡,4年卡,5永久卡。
LicenseTypeStr授权类型描述。
Message提示信息。
RemainingCount次卡剩余次数。
ServerTime服务器时间。
Status激活状态:1成功,0失败。

接口名称

Activate

DLL调用

long Activate(string userCode, string softCode, string softVersion, string dealerCode, string licenseKey);

参数说明

参数名类型说明
userCode字符串用户码。
softCode字符串软件码。
softVersion字符串软件版本。(用于区分你自己的软件版本信息,未来可用于版本控制,可空)
dealerCode字符串经销商码。(用于区分你自己的经销商信息,未来可用于版本控制,可空)
licenseKey字符串激活码。

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int ret = ola.Activate("value", "value", "value", "value", "value");
csharp
using OLAPlug;

var ola = new OLAPlugServer();
int ret = ola.Activate("value", "value", "value", "value", "value");
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
ret = ola.Activate("value", "value", "value", "value", "value")
java
import com.olaplug.OLAPlugServer;

OLAPlugServer ola = new OLAPlugServer();
int ret = ola.Activate("value", "value", "value", "value", "value");
cpp
var ola = com("OlaPlug.OlaSoft")
var ret = ola.Activate("value", "value", "value", "value", "value")
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
ret = ola.Activate("value", "value", "value", "value", "value")
text
.局部变量 ola, OLAPlug
ola.创建 ()
ret = ola.Activate(“value”, “value”, “value”, “value”, “value”)
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var ret = ola.Activate("value", "value", "value", "value", "value");
text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
整数 ret = ola.Activate("value", "value", "value", "value", "value")
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int32_t ret = ola.Activate("value", "value", "value", "value", "value");

原生 DLL 调用

cpp
Activate(instance, "value", "value", "value", "value", "value");
csharp
using System.Runtime.InteropServices;
using System.Text;

[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long Activate(string userCode, string softCode, string softVersion, string dealerCode, string licenseKey);

Activate(instance, "value", "value", "value", "value", "value");
python
from ctypes import CDLL, c_int, c_int64, create_string_buffer

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
ola.Activate(instance, "value", "value", "value", "value", "value")

返回值

成功返回JSON字符串格式的激活结果;失败返回 0。

注意事项

  • 返回的字符串指针需要调用 FreeStringPtr 接口释放内存。
  • 激活码需要从授权平台获取,每个激活码通常只能使用一次。
  • 用户码、软件码和经销商码需要与申请激活码时的信息保持一致。